@echo off
set port=30012

rem findpid PID
for /f "tokens=5" %%a in ('netstat -ano ^| findstr :%port%') do set pid=%%a

rem if pid kill .....
if defined pid (
    echo killport %port%,PID: %pid%...
    taskkill /F /PID %pid%
) else (
    echo noport %port%
)

rem start JAR ...
echo start jar.. port: %port%...
javaw -jar -Dfile.encoding=UTF-8 smart-admin.jar >run.log 2>&1 &